#if defined(_MSC_VER)
#pragma once
#endif

#ifndef LM_SHAPE_SPHERE_H
#define LM_SHAPE_SPHERE_H

#include "../core/lm.h"
#include "../core/shape.h"

class Sphere : public Shape {
public:
	Sphere(const Transform *o2w, const Transform *w2o, bool ro, Reference<Material> mat, float rad);
	//~Sphere() { }
	BBox ObjectBound() const;
	bool Intersect(const Ray &ray, Intersection *isect) const;
	bool IntersectP(const Ray &ray) const;
	void FillIntersection(const Ray &ray, Intersection *isect) const;
	//BSDF *GetBSDF(const Intersection &isect) const;
	Point3 Sample(const Point3 &p, const Point2 &sample, Normal *Ns) const;
	Point3 Sample(const Point2 &sample, Normal *Ns) const;
	float Pdf(const Point3 &p, const Vector3 &wi) const;
	float Area() const;
private:
	float radius;
};

#endif	// LM_SHAPE_SPHERE_H